﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.Master" AutoEventWireup="true"
    Inherits="Wjtour.Web.Admin.article_type.list" %>

<%@ Import Namespace="Wjtour.Domain" %>
<%@ Import Namespace="Wjtour.Common" %>
<%@ Import Namespace="Wjtour.Domain.dto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <table cellspacing="0" width="100%" style="border: 1px  solid #DCEAF7; border-bottom: 0px;
        background: #E9F2FB;">
        <tr>
            <td width="150px">
                &nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" />&nbsp;<a
                    href="/admin/article_type/addedi.aspx" class="link3">[新增栏目]</a>
            </td>
            <td width="" align="right">
                栏目名：<asp:TextBox ID="q" Text="" runat="server" />&nbsp;<asp:Button ID="submit" runat="server"
                    Text="提交" />
            </td>
            <td width="150px" align="right">
                共有 <b>
                    <%=data.Count%></b> 条记录&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <table id="listtable" border="1" cellpadding="0" cellspacing="0" bordercolor="#dddddd">
        <tr>
            <th width="3%">
                <input type="checkbox" onclick="checkAll(this,'ids')" />
            </th>
            <th width="">
                栏目名
            </th>
            <th width="6%">
                内容量
            </th>
            <th width="5%">
                排序
            </th>
            <th width="220">
                操作
            </th>
        </tr>
        <%
            List<articletype_num> ptypes = data.Where(t => t.pid == 0).ToList();
            foreach (var ptype in ptypes)
            {
                string title = "";
                string disabled = "";
                if (ptype.sys == 1)
                {
                    title = "系统数据，不允许删除！";
                    disabled = "disabled='disabled'";
                }
                else
                {
                    title = "";
                    disabled = "";
                }
        %>
        <tr>
            <td>
                <input title="<%=title %>" <%=disabled %> type='checkbox' name='ids'
                    value='<%=ptype.id %>' />
            </td>
            <td style='text-align: left; padding-left: 5px'>
                <span style="font-size: 12px; font-family: wingdings">
                    <%=ptype.pid%></span>&nbsp;<%=ptype.title%>(cid:
                <%=ptype.pid%>)
            </td>
            <td>
                <%=ptype.articlenum%>&nbsp;
            </td>
            <td>
                <%=ptype.sort%>&nbsp;
            </td>
            <td>
                <a href='/admin/article_type/addedi.aspx?id=<%=ptype.id %>&do=add'>添加子栏目</a> |&nbsp;<a
                    href='/admin/article/addedi.aspx?cid=<%=ptype.id %>'>添加内容</a> |&nbsp;<a href='/admin/article_type/addedi.aspx?id=<%=ptype.id %>&do=edi'>修改栏目</a>
            </td>
        </tr>
        <%
List<articletype_num> subtypes = data.Where(t => t.pid == ptype.id).ToList();
if (subtypes != null && subtypes.Count > 0)
{
    foreach (var item in subtypes)
    {
        if (item.sys == 1)
        {
            title = "系统数据，不允许删除！";
            disabled = "disabled='disabled'";
        }
        else
        {
            title = "";
            disabled = "";
        }
        %>
        <tr>
            <td>
                <input title="<%=title %>" <%=disabled %> type='checkbox' name='ids'
                    value='<%=item.id %>' />
            </td>
            <td style='text-align: left; padding-left: 5px'>
                &nbsp;&nbsp;<span style="font-size: 12px; font-family: wingdings">
                    <%=item.pid %></span><%=item.title %>(cid:
                <%=item.pid %>)
            </td>
            <td>
                <%=item.articlenum %>&nbsp;
            </td>
            <td>
                <%=item.sort %>&nbsp;
            </td>
            <td>
                <a href='/admin/article_type/addedi.aspx?id=<%=item.id %>&do=add'>添加子栏目</a> |&nbsp;<a
                    href='/admin/article/addedi.aspx?cid=<%=item.id %>'>添加内容</a> |&nbsp;<a href='/admin/article_type/addedi.aspx?id=<%=item.id %>&do=edi'>修改栏目</a>
            </td>
        </tr>
        <%
}
        }
            }
            
        %>
    </table>
    <div style="position: relative; padding-bottom: 10px">
        <input type="hidden" id="delRef" value="<%=delIds.ClientID %>" />
        <asp:HiddenField ID="delIds" runat="server" />
        <div style="position: absolute; left: 5px; top: 5px">
            <asp:Button ID="delButton" runat="server" Text="删除" OnClientClick="return delConfirm()" />
        </div>
        <div class="megas512" style="margin-top: 15px;">
        <%=PagerHtml%>
        </div>
    </div>
</asp:Content>
